package cn.wolfcode.luowowo.msg;

import cn.wolfcode.luowowo.common.CodeMsg;

import java.text.MessageFormat;

/**
 * Created by wolfcode-lanxw
 */
public class MsgCodeMsg extends CodeMsg {
    private MsgCodeMsg(Integer code,String msg){
        super(code,msg);
    }
    public static final MsgCodeMsg DEFAULT_ERROR = new MsgCodeMsg(500201,"消息服务异常，稍后再试");
    public static final MsgCodeMsg PARAM_ERROR = new MsgCodeMsg(500202,"参数异常:{0}");
    
    public CodeMsg fillArgs(Object... args) {
        return new MsgCodeMsg(this.getCode(), MessageFormat.format(this.getMsg(),args));
    }
}
